package com.yuanfengerp.inventorycheck.inadvancecheck.contorller;

import com.yuanfengerp.inventorycheck.inadvancecheck.model.Inadvancecheck;
import com.yuanfengerp.inventorycheck.inadvancecheck.service.impl.InadvancecheckImpl;
import com.yuanfengerp.publicUtil.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@CrossOrigin
public class InadvanceCon {
    @Autowired
    InadvancecheckImpl iaki;

    //查询盘点仓库
    @PostMapping("/selectInadvanceAll")
    public Result selectInadvanceAll(@RequestBody Map<String ,Object> params){
        return iaki.selectInadvanceAll(params);
    }


    //查询盘点的仓库以及该仓库所有商品
    @PostMapping("/selectInadvanceAndshopAll")
    public Result selectInadvanceAndshopAll(String document_ID){
        return iaki.selectInadvanceAndshopAll(document_ID);
    }


    //添加预先盘点单
    @PostMapping("/addInadvance")
    public Result addInadvance(@RequestBody Inadvancecheck inadvancecheck){
        return iaki.addInadvance(inadvancecheck);
    }

    //修改预先盘点单信息
    @PostMapping("/updateInadvance")
    public Result updateInadvance(@RequestBody Inadvancecheck inadvancecheck){
        return iaki.updateInadvance(inadvancecheck);
    }

    //删除预先盘点单
    @PostMapping("/deleteInadvance")
    public Result deleteInadvance(String document_ID){
        return iaki.deleteInadvance(document_ID);
    }
}
